<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" href="/css/heads.css">
  <link rel="stylesheet" href="/css/poin.css">
  <title>Document</title>
</head>

<body>
  <!-- 页头部分 -->
  <div class="nav">
    <ul>
      <li class="pc">
        <a href="index.html">首页</a>
      </li>
      <li class="pc">
        <a href=""> 品牌历史</a>
        <div class="fen">
          <ul class="fen_en">
            <li><a href="index_story.html">一个美丽的故事</a> </li>
            <li>传承人的故事</li>
          </ul>
        </div>
      </li>
      <li class="pc">
        <a href="poins.html">产品中心</a>
        <div class="fen">
          <ul class="fen_en fen1">
            <li><a href=""><a href="poin_sj.html">三角钢琴</a></li>
            <li><a href="poin_ls.html">立式钢琴</a></li>
          </ul>
        </div>
      </li>
      <li class="pc">
        <a href="index_zt.html">展厅</a>
      </li>
      <a class="logo" href="#"></a>
      <li class="pc"><a href="new.html?page=1">新闻首页</a></li>
      <li class="pc">服务
        <div class="fen">
          <ul class="fen_en fen2">
            <li><a href="maintain.html">保养与维护</a></li>
            <li><a href="#">经销商查询</a></li>
          </ul>
        </div>
      </li>
      <li class="pc"><a href="">联系</a></li>
      <li class="pc"><a href="lodin.html">个人中心</a></li>
    </ul>
    <span class="ico">
      <em></em>
      <em></em>
      <em></em>
    </span>
  </div>
  <div class="navBou">
    <div>首页</div>
    <div>
      品牌历史
      <p><a href="">个美丽的故事</a></p>
      <p><a href="">传承人的故事</a></p>
    </div>
    <div>
      产品中心
      <p><a href="">三角钢琴</a></p>
      <p><a href="">立式钢琴</a></p>
    </div>
    <div><a href="index_zt.html">展厅</a></div>
    <div><a href="new.html">新闻首页</a></div>
    <div>服务
      <p><a href="">保养与维护</a></p>
      <p><a href="">经销商查询</a></p>
    </div>
  </div>

  <!-- denner -->
  <div class="denner">
    <div>
      <h2>立式钢琴</h2>
      <a href="">查看详情</a>
    </div>
    <div>
      <h2>三角钢琴</h2>
      <a href="">查看详情</a>
    </div>
  </div>
  <!--text -->
  <div class="text">
    <h2>普雷耶立式钢琴</h2>
    <p>尽管无数的普雷耶钢琴在这已存在两个世纪的法国制造商中取得了巨大的成功，但P型号无疑是其中最大的成就之一……这使它们赢得了“立式钢琴之王”的称号！
      如今，P系列立式钢琴仍旧按照同样严格的质量标准生产，以确保您的钢琴给您带来如同三角钢琴一样的音乐性和娱乐性。 所有P型号立式钢琴都包含一把匹配的琴凳，并配有静音系统。</p>
  </div>
  <div class="product" id="product"></div>
  <div class="footer">
    <div class="footer-en">
      <div class="flex_box">
        <img src="/img/link1.png" alt="">
        <img src="/img/link2.png" alt="">
        <img src="/img/link3.png" alt="">
        <img src="/img/link4.png" alt="">
        <img src="/img/link5.png" alt="">
      </div>
      <div class="flex_box">
        <ul>
          <h4>客户服务</h4>
          <li><a href="">经销商查询</a></li>
          <li><a href="">联系我们</a></li>
        </ul>
        <div>
          <img src="/img/home_07.jpg" alt="">
          <img src="/img/home_09.jpg" alt="">
          <img src="img/home_11.jpg" alt="">
          <img src="/img/home_13.jpg" alt="">
        </div>
      </div>
    </div>
  </div>
  <div class="footer2">
    <div class="footer_en">
      <div></div>
      <div>Pleyel © 2019 普雷叶乐器（上海）有限公司 沪ICP备18021165号-1</div>
    </div>
  </div>
  <script src="../js/header.js"></script>
  <script>
    let product = document.getElementById('product')
    const xhr = new XMLHttpRequest();
    xhr.onreadystatechange = function () {
      if (xhr.readyState == 4) {
        if (xhr.status >= 200 && xhr.status < 300) {
          var result = JSON.parse(xhr.responseText).data;
          product.innerHTML = lsdata(result);
        }
      }
    }
    xhr.open('GET', '/v1/main/ls', true);
    xhr.send();
    /* 建立数据交互函数 */
    function lsdata(arr) {
      let str = ``
      for (let i = 0; i < arr.length; i++) {
        let obj = arr[i];
        let umn=obj.price+'';
        let umnval=umn.replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + '.00'
        str += ` 
        <div class="product-item">
        <img src="/img/${obj.url}.jpg" alt="">
        <div>
        <h2>${obj.lsname}</h2>
        <div>${obj.texts}</div>
        <p><span>全国统一零售价</span><span>RMB</span>${umnval}</p>
        <a href="poin_ls_datatils.html?lsname=${obj.lsname}" class="btn">查看详情</a>
        </div>
        </div>
        `
      }
      return str;
    }
  </script>
</body>

</html>